<div class="row">
	<div class="col-xs-12 col-md-12">
		<div class="widget">
			<div class="widget-header bg-blue">
				<i class="widget-icon fa fa-arrow-down"></i>
				<span class="widget-caption">分销商管理</span>
				<div class="widget-buttons">
					<a href="#" data-toggle="maximize">
						<i class="fa fa-expand"></i>
					</a>
					<a href="#" data-toggle="collapse">
						<i class="fa fa-minus"></i>
					</a>
					<a href="#" data-toggle="dispose">
						<i class="fa fa-times"></i>
					</a>
				</div>
			</div>
			<div class="widget-body">
				<div class="table-toolbar">
					<a href="{:U('Cms/Fxs/userSet/')}" class="btn btn-primary" data-loader="Joel-loader" data-loadername="设置分组">
						<i class="fa fa-plus"></i>新增分销商
					</a>
					<div class="pull-right">
						<form id="Joel-search">
							<label><select name="stype" class="form-control input-sm"><option value='1' <eq name='stype' value='1'>selected</eq>>按分销商姓名【模糊】</option><option value='2' <eq name='stype' value='2'>selected</eq>>按分销商ID</option><option value='3' <eq name='stype' value='3'>selected</eq>>按分销商ID搜索下级</option></select></label>
							<label><input name="search" type="search" class="form-control input-sm" placeholder="请输入搜索条件"></label>
							<a href="{:U('Cms/Fxs/user/')}" class="btn btn-success" data-loader="Joel-loader" data-loadername="分销商管理" data-search="Joel-search">
								<i class="fa fa-search"></i>搜索
							</a>
						</form>
					</div>
				</div>

				<table id="Joel-table" class="table table-bordered table-hover">
					<thead class="bordered-darkorange">
						<tr role="row">
							<th>ID</th>
							<!--<th>PID</th>
							<th>Path</th>-->
							<th>层级</th>
							<th>自定义编码</th>
							<th>分销商名称</th>	
							<th>分销商电话</th>	
							<th>后台登陆名</th>
							<th>可开设下级总数</th>	
							<th>累计佣金</th>
							<th>会员总数</th>
							<th>关注会员</th>
							<th>累计购买</th>
							<th>加入时间</th>
							<th>渠道二维码</th>
							<th>分销商状态</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
						<volist name="cache" id="vo">
							<tr id="item{$vo.id}">
								<td class=" sorting_1">{$vo.id}</td>
								<!--<td class=" ">{$vo.pid}</td>
								<td class=" ">{$vo.bpath}</td>-->
								<td class=" ">{$vo.lv}</td>
								<td class=" ">{$vo.no}</td>
								<td class=" ">{$vo.nickname}</td>
								<td class=" ">{$vo.mobile}</td>
								<td class=" ">{$vo.username}</td>	
								<td class=" ">{$vo.sonnum}</td>	
								<td class=" ">{$vo.total_xxyj}元</td>
								<td class=" ">{$vo.total_xxlink}人</td>
								<td class=" ">{$vo.total_xxsub}人</td>
								<td class=" ">{$vo.total_xxbuy}次</td>
								<td class=" ">{$vo.ctime|date='Y-m-d',###}</td>
								<td class=" "><button class="btn btn-xs btn-blue showqr" data-title="{$vo.nickname}" data-qr="{$vo.qrticket}">点击查看</button></td>
								<td class=" "><eq name="vo.status" value="1"><button class="btn btn-xs btn-success">正常</button><else/><button class="btn btn-xs btn-danger">停用</button></eq></td>
								<td class="center "><a href="{:U('Cms/Fxs/userSet/',array('id'=>$vo['id']))}" class="btn btn-success btn-xs" data-loader="Joel-loader" data-loadername="设置分销商"><i class="fa fa-edit"></i> 编辑</a></td>
							</tr>
							<volist name="vo['_child']" id="vo2">
								<tr id="item{$vo2.id}">
									<td class=" sorting_1">{$vo2.id}</td>
									<!--<td class=" ">{$vo2.pid}</td>
									<td class=" ">{$vo2.bpath}</td>-->
									<td class=" ">{$vo2.lv}</td>
									<td class=" ">{$vo2.no}</td>
									<td class=" ">&nbsp;&nbsp;└{$vo2.nickname}</td>
									<td class=" ">{$vo2.mobile}</td>
									<td class=" ">{$vo2.username}</td>	
									<td class=" ">{$vo2.sonnum}</td>	
									<td class=" ">{$vo2.total_xxyj}元</td>
									<td class=" ">{$vo2.total_xxlink}人</td>
									<td class=" ">{$vo2.total_xxsub}人</td>
									<td class=" ">{$vo2.total_xxbuy}次</td>
									<td class=" ">{$vo2.ctime|date='Y-m-d',###}</td>
									<td class=" "><button class="btn btn-xs btn-blue showqr" data-title="{$vo2.nickname}" data-qr="{$vo2.qrticket}">点击查看</button></td>
									<td class=" "><eq name="vo2.status" value="1"><button class="btn btn-xs btn-success">正常</button><else/><button class="btn btn-xs btn-danger">停用</button></eq></td>
									<td class="center "><a href="{:U('Cms/Fxs/userSet/',array('id'=>$vo2['id']))}" class="btn btn-success btn-xs" data-loader="Joel-loader" data-loadername="设置分销商"><i class="fa fa-edit"></i> 编辑</a></td>
								</tr>
								<foreach name="vo2['_child']" item="vo3">
									<tr id="item{$vo3.id}">
									<td class=" sorting_1">{$vo3.id}</td>
									<!--<td class=" ">{$vo3.pid}</td>
									<td class=" ">{$vo3.bpath}</td>-->
									<td class=" ">{$vo3.lv}</td>
									<td class=" ">{$vo3.no}</td>
									<td class=" ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└{$vo3.nickname}</td>
									<td class=" ">{$vo3.mobile}</td>
									<td class=" ">{$vo3.username}</td>		
									<td class=" ">{$vo3.sonnum}</td>	
									<td class=" ">{$vo3.total_xxyj}元</td>
									<td class=" ">{$vo3.total_xxlink}人</td>
									<td class=" ">{$vo3.total_xxsub}人</td>
									<td class=" ">{$vo3.total_xxbuy}次</td>
									<td class=" ">{$vo3.ctime|date='Y-m-d',###}</td>
									<td class=" "><button class="btn btn-xs btn-blue showqr" data-title="{$vo3.nickname}" data-qr="{$vo3.qrticket}">点击查看</button></td>
									<td class=" "><eq name="vo3.status" value="1"><button class="btn btn-xs btn-success">正常</button><else/><button class="btn btn-xs btn-danger">停用</button></eq></td>
									<td class="center "><a href="{:U('Cms/Fxs/userSet/',array('id'=>$vo3['id']))}" class="btn btn-success btn-xs" data-loader="Joel-loader" data-loadername="设置分销商"><i class="fa fa-edit"></i> 编辑</a></td>
									</tr>	
									<foreach name="vo3['_child']" item="vo4">
										<tr id="item{$vo4.id}">
										<td class=" sorting_1">{$vo4.id}</td>
										<!--<td class=" ">{$vo3.pid}</td>
										<td class=" ">{$vo3.bpath}</td>-->
										<td class=" ">{$vo4.lv}</td>
										<td class=" ">{$vo4.no}</td>
										<td class=" ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└{$vo4.nickname}</td>
										<td class=" ">{$vo4.mobile}</td>
										<td class=" ">{$vo4.username}</td>		
										<td class=" ">0</td>	
										<td class=" ">{$vo4.total_xxyj}元</td>
										<td class=" ">{$vo4.total_xxlink}人</td>
										<td class=" ">{$vo4.total_xxsub}人</td>
										<td class=" ">{$vo4.total_xxbuy}次</td>
										<td class=" ">{$vo4.ctime|date='Y-m-d',###}</td>
										<td class=" "><button class="btn btn-xs btn-blue showqr" data-title="{$vo4.nickname}" data-qr="{$vo4.qrticket}">点击查看</button></td>
										<td class=" "><eq name="vo4.status" value="1"><button class="btn btn-xs btn-success">正常</button><else/><button class="btn btn-xs btn-danger">停用</button></eq></td>
										<td class="center "><a href="{:U('Cms/Fxs/userSet/',array('id'=>$vo4['id']))}" class="btn btn-success btn-xs" data-loader="Joel-loader" data-loadername="设置分销商"><i class="fa fa-edit"></i> 编辑</a></td>
										</tr>										
									</foreach>
								</foreach>
							</volist>
						</volist>
												
					</tbody>
				</table>
				<div class="row DTTTFooter">
					{$page}
				</div>
			</div>
		</div>
	</div>
</div>
<!--面包屑导航封装-->
<div id="tmpbread" style="display: none;">{$breadhtml}</div>
<script type="text/javascript">
	setBread($('#tmpbread').html());
</script>
<!--/面包屑导航封装-->
<!--QRCODE封装-->
<script type="text/javascript">
var qrs=$('.showqr');
$(qrs).on('click',function(){
	var title=$(this).data('title')+'-渠道二微码';
	var ticket=encodeURI($(this).data('qr'));
	var u='https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket='+ticket;
	var mb="<div style='width:100%;text-align:center'><img src='"+u+"' /><p>若未显示二微码，请重新打开或编辑一次分销商。</p></div>";
	bootbox.dialog({
	  message: mb,
	  title: title,
	  className: "modal-darkorange",
	  buttons: {
		"取消": {
		className: "btn-danger",
		callback: function () { }
	  	}
	  }
	});
});
</script>
<!--/QRCODE封装-->
